package com.airbat.prize.common.enums;

import com.airbat.prize.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 指令类型
 */
@Getter
@AllArgsConstructor
public enum ProcessTypeEnum implements IntArrayValuable {

    ADD(1, "新增"),
    ZRDW(2, "责任单位"),
    DISPOSE(3, "处置"),
    VISIT(4, "回访"),
    UNDO(5, "撤管"),
    IMPORTANT(6, "重点"),
    COLOR4(9, "四色"),
    CLUE_INSPECT(11, "核查提纲"),
    CLUE_REPORT(12, "核查报告"),
    CLUE_FEEDBACK_AUDITING(13,"反馈审批");

    /**
     * 值
     */
    private final Integer value;
    /**
     * 名称
     */
    private final String name;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProcessTypeEnum::getValue).toArray();

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static String getName(Integer value) {
        return Arrays.stream(values()).filter(tr -> tr.getValue() == value).findFirst().get().getName();
    }
}
